include ../rules.mk


all: enter  programs leave
	@echo "====> Finished"

enter:
	@echo "==> building in $(HERE)"

leave:
	@echo "==> all done in $(HERE)"

programs : libs md 

libs:
	@$(MAKE) -s -C ../mds

md: $(call to_object,md.c mds_density.c) ../.libs/libmds.a
	$(LINK) -lz

gcc-opt:
	@$(MAKE) rebuild MY_CFLAGS="-O2 -DNDEBUG=1 -ftree-vectorize"

icc-opt:
	@$(MAKE) rebuild CC=icc MY_CFLAGS="-O2 -DNDEBUG=1"

clean:
	$(CLEAN)
	@rm -f md md.exe md.xyz energy.txt md.mds md.mds.gz density*.txt
	
rebuild:
	@$(MAKE) -s -C .. clean && $(MAKE) -s all
	
-include $(DEPENDS)

